class Solution:
    def interpret(self, command: str) -> str:
        ans = ''
        i = 0
        while i < len(command):
            c = command[i]
            if c == 'G':
                ans += 'G'
                i += 1
                continue
            elif c == '(' and command[i + 1] == ')':
                ans += 'o'
                i += 2
                continue
            elif c == '(' and command[i + 1] == 'a':
                ans += 'al'
                i += 4
                continue
            i += 1
        return ans

    def interpret2(self, command: str) -> str:
        return command.replace('(', 'o').replace(')', 'al')